//延时1秒执行


function sleep(times) {
    return new Promise(resolve => {
        setTimeout(() => {
            resolve("执行")
        }, times);
    })
}

//简写
function sleep1(times) {
    return new Promise(resolve => setTimeout(resolve, times))
}

async function do1() {
    console.log("start");
    let res = await sleep1(2000);
    console.log('res:', res);
    console.log("end")
}

do1()